package File;

import java.io.FileInputStream;
import java.io.IOException;
import java.io.InputStream;
import java.util.Scanner;

/**
 * Created with IntelliJ IDEA.
 * Description:
 * User: LXW
 * Date: 2022-04-04
 * Time: 13:44
 */
public class Demo10 {
    public static void main(String[] args) {
        try (InputStream is = new FileInputStream("hello-world")){
            try (Scanner scanner = new Scanner(is,"utf-8")){
                while(scanner.hasNext()) {
                    String s = scanner.next();
                    System.out.println(s);
                }
            }
        }catch (IOException e) {
            e.printStackTrace();
        }
    }
}
